Broadcast is an important way for sending network data, in which a source device sends a data packet to multiple target devices. Broadcast is a one-to-multiple sending manner. In certain situations, a source device sends a data packet to a part of adjacent devices, for example, broadcasts the data packet to all router devices, while adjacent non-router devices may discard the received broadcast data packet. In some other situations, a source device sends a data packet to all adjacent devices, that is to say, target devices to which the source device sends the data packet. The target devices are some devices in a network in certain situations, and are all the devices in the network in some other situations. Generally, a source device sends a data packet to all adjacent target devices in the broadcasting manner. All the adjacent target devices receiving the data packet forward the data packet to their own adjacent target devices, until all the target devices have received the data packet.
ZigBee is a low-speed short-distance wireless communications technology, and a reliable broadcasting method is proposed in the ZigBee standard. The implementation of the broadcasting method in the ZigBee standard is as follows. A broadcast table is stored in each device in a communication network, where the broadcast table includes a plurality of record entries that are used to record an identifier of an initiated or a received broadcast data packet. The identifier uniquely identifies a data packet. After receiving the data packet, the device searches whether a record entry identical with the identifier of the received data packet exists in the broadcast table, and if such a record entry exists in the broadcast table, it is judged that the received data packet is a repeatedly received packet, and the data packet is discarded; if such a record entry does not exist in the broadcast table, it is judged that the received data packet is a newly received packet, and the newly received packet is forwarded. Multiple methods for identifying a data packet exist, for example, a source address and a time stamp may be used to identify a data packet, or only a time stamp is used to identify a data packet, or a source address and a sequence number may be used to identify a data packet.
If each target device in the network forwards the received data packet, the same data packet may be forwarded repeatedly, thereby causing great consumption of network bandwidth and affecting normal network communications. In the broadcasting method of the ZigBee standard, the range of forwarding the data packet is restricted, so as to reduce the consumption of network bandwidth caused by repeated transmission of the data packet.
The inventor of the present application finds that, although the above broadcasting method with hop restriction added reduces the consumption of network bandwidth, problems exist in the reliability of the broadcasting method. As a result, certain devices in the network may fail to receive the data packet initiated and sent by the source device.